<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base2.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style2.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
		<title>账户管理-添加账号</title>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<div class="header_top"></div>
				<div class="header_bottom clearfix">
					<div class="header_logo fl">
						<img src="${pageContext.request.contextPath}/images/images/index-logo.png">
					</div>
					<ul class="header_nav clearfix fl">
						<li>
							<a href="${pageContext.request.contextPath}/morder/waitOrderList.html" >订单管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html">家政人员管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/supplier/account.html" >财务管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/admin/accountInfo.html" class="on">账户管理</a>
						</li>
					</ul>
					<div class="header_user fr">
						<img src="${pageContext.request.contextPath}/images/images/user.png">欢迎您，<i>admin</i><a href="${pageContext.request.contextPath}/manager/loginout.html">【切换账号】</a>
					</div>
				</div>
			</div>
			<div class="main clearfix">
				<div class="main_menu fl">
					<%-- <div class="menu_name">
						<a href="${pageContext.request.contextPath}/admin/toPassword.html">
							<img src="${pageContext.request.contextPath}/images/images/xgmm.png">
							<p>修改密码</p>
						</a>
					</div>
					<div class="menu_name on">
						<a href="${pageContext.request.contextPath}/admin/list/1.html">
							<img src="${pageContext.request.contextPath}/images/images/zh_zhgl.png">
							<p>账号管理</p>
						</a>
					</div> --%>
					
						<div class="menu_name">
						<a href="${pageContext.request.contextPath}/admin/accountInfo.html">
							<img src="${pageContext.request.contextPath}/images/images/zh_zhxx.png">
							<p>账户信息</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/admin/editPwd.html">
							<img src="${pageContext.request.contextPath}/images/images/xgmm.png">
							<p>修改密码</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/admin/agreementInfo.html">
							<img src="${pageContext.request.contextPath}/images/images/hzxy.png">
							<p>合作协议</p>
						</a>
					</div>
					
					<div class="menu_name on">
						<a href="${pageContext.request.contextPath}/admin/supplierlist/1.html">
						<img src="${pageContext.request.contextPath}/images/images/zh_zhgl.png">
						<p>账号管理</p>
						</a>
					</div>	
					
				</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">当前位置：账户管理 > 添加账号</div>
							<div class="cont_top_time fr"><i><img src="${pageContext.request.contextPath}/images/images/refresh.png">刷新</i></div>
						</div>
					</div>
					<div class="main_cont_bottom">
						<div class="main_inner">
							<form action="${pageContext.request.contextPath}/admin/addAdmin.html" method="post" id="myform" class="add_bacth">
								<p>账户名：<input type="text" value="" class="w200" id="wAUsername" name="wAUsername"><i class="ml15 c999">数字和字母组合</i></p>
								<p>角&nbsp;&nbsp;&nbsp;&nbsp;色：
								<select class="w200" id="wARoleId" name="wARoleId">
								<!-- <option value="1">渠道管理员</option>
        						 <option value="8">平台管理员8</option>
        						  <option value="9">平台管理员9</option> -->
        						   <option value="10">家政商管理员</option>
								 <!-- <option value="11">非家政商管理员</option> -->
								</select>
								<p>联系人：<input type="text" class="w200" name="wARealName" id="wARealName"></p>
								<p>电&nbsp;&nbsp;&nbsp;&nbsp;话：<input type="text" class="w200" name="wATelephone" id="wATelephone"></p>
								</p>
								<p>状&nbsp;&nbsp;&nbsp;&nbsp;态：
								<input type="button" value="启用" class="w80 mr15 on" onclick="changeStatus(1)">
								<input type="button" value="停用" class="w80" onclick="changeStatus(0)">
								<input type="hidden" id="status" name="status" value="1">
								</p>
								<p>密&nbsp;&nbsp;&nbsp;&nbsp;码：账号统一密码为123456，请登录后立即修改！</p>
								<p class="add_bacth_btn ml20">
								<input type="button" value="取消" onclick="clearValue();">
								<input type="button" value="确认添加" onclick="checkValue();"></p>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(".add_bacth .w80").click(function(){
				$(".add_bacth .w80").removeClass("on");
				$(this).addClass("on").siblings().removeClass("on");
			});
			
			function clearValue(){
				$("#wAUsername").val("");
			}
			
			function changeStatus(num){
				$("#status").val(num);
			}
			
			function checkValue(){
				var username=$("#wAUsername").val();
				if(username==null || username==""){
					alert("账户名不能为空！");
					return false;
				}
				var re =  /^[0-9a-zA-Z]*$/g;  //判断字符串是否为数字和字母组合  
			    if (!re.test(username))  
			    {  
			    	alert("账户名不能输入汉字！");
			        return false;  
			    }
				
				var wARealName=$("#wARealName").val();
				if(wARealName==null || wARealName==""){
					alert("联系人姓名不能为空！");
					return false;
				}
				
				if(wARealName.length>8){
					alert("请输入8个字内的联系人姓名！");
					return false;
				}
				
				var wSTelephone=$("#wATelephone").val();
				if(wSTelephone==null || wSTelephone==""){
					alert("请输入联系电话！");
					return false;
				}
				if(!(/^1(3|4|5|7|8)\d{9}$/.test(wSTelephone))){    
					alert("请输入有效的手机号码！");    
					return false;  
				} 
				
				$("#myform").submit();
			}
		</script>
	</body>
</html>
